import http from '@/common/http/interface.js'

//设置baseUrl
http.config.baseUrl = "https://001hezi.oss-cn-beijing.aliyuncs.com/game-list/";

//设置请求前拦截器
http.interceptor.request = (config) => {
    //添加通用参数
    // config.header = {
    //     "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    // }
	config.data = Object.assign(config.data || {}, {
		q: Math.random(),
	});
	return config;
}

//设置请求结束后拦截器
http.interceptor.response = (response) => {
    //判断返回状态 执行相应操作
    return response;
}
export default http